package com.gxuwz.medical.domain.chronicinfo;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.gxuwz.medical.database.DbUtil;

public class Recordfree {
private String perscode;
	private Integer freetotal;
	public String getPerscode() {
		return perscode;
	}
	public void setPerscode(String perscode) {
		this.perscode = perscode;
	}
	public Integer getFreetotal() {
		return freetotal;
	}
	public void setFreetotal(Integer freetotal) {
		this.freetotal = freetotal;
	}
	private void saveToDB(Connection conn)throws SQLException{

		  PreparedStatement pstmt=null;
		  try{
			  StringBuffer sqlBuff=new StringBuffer("INSERT INTO t_recordfree (perscode, freetotal)");
			  			   sqlBuff.append("VALUES (?, ?, ?, ?,?,?)");
			  pstmt=conn.prepareStatement(sqlBuff.toString());
			  int index=1;
			  pstmt.setString(index++, this.perscode);
			  pstmt.setInt(index++, this.freetotal);
			  int count =pstmt.executeUpdate(); 
		  }catch(SQLException e){
			  e.printStackTrace();
			  throw e;
		  }finally{
			  DbUtil.close(pstmt);
		  } 
	}
}
